home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1990-05-16 | 922 b | 46 lines |
- 5 CLS:RANDOMIZE TIMER
- 10 KEY OFF
- 20 SCREEN 1,1
- 30 COLOR 3,0
- 40 XCO = 160:YCO=100:R=10
- 45 DIR = 1
- 46 INC = 3
- 47 COL = 2
- 50 WHILE INKEY$<>"q"
- 58 CTA = 1
- 59 WHILE CTA < INT(10*RND+1) + 8
- 60 CIRCLE (XCO,YCO),R,COL
- 65 IF XCO < 320 AND XCO > 0 AND YCO > 0 AND YCO < 200 THEN GOSUB 230 ELSE GOSUB 600
- 66 CTA = CTA + 1
- 68 WEND
- 210 WHI = INT(RND*2+1)
- 220 IF RND*10 > 5 OR CTA > 19 THEN ON DIR GOSUB 350,370,390,410
- 222 WEND
- 225 GOTO 280
- 230 IF DIR = 1 THEN XCO = XCO + INC
- 240 IF DIR = 2 THEN YCO = YCO + INC
- 250 IF DIR = 3 THEN XCO = XCO - INC
- 260 IF DIR = 4 THEN YCO = YCO - INC
- 270 RETURN
- 280 LOCATE 25,1
- 290 INPUT "press ENTER to continue";ANS$
- 300 SCREEN 0
- 310 WIDTH 80
- 320 KEY ON
- 330 WHI = INT(RND*2+1)
- 340 LOCATE 1,1:PRINT WHI
- 350 IF DIR = 1 AND WHI = 1 THEN DIR = 4 ELSE DIR = 2
- 360 RETURN
- 370 IF DIR = 2 AND WHI = 1 THEN DIR = 3 ELSE DIR = 1
- 380 RETURN
- 390 IF DIR = 3 AND WHI = 1 THEN DIR = 2 ELSE DIR = 4
- 400 RETURN
- 410 IF DIR = 4 AND WHI = 1 THEN DIR = 1 ELSE DIR = 3
- 420 RETURN
- 600 CTA = 20
- 605 COL = INT(RND*3+1):R = R + 1
- 610 XCO = 160 : YCO = 100
- 612 COLOR INT(RND*15+1)
- 36414
- 8271 =WIDTH LETINKEY$>A<0x9F!>2d
-